using UnityEngine;
using UnityEngine.UI;

public class GUICharacterPreset : MonoBehaviour
{
	public Animator animman;

	public Animator animwoman;

	public RawImage GUIImage;

	public Text Name;

	public string Description;

	public int Index;

	[HideInInspector]
	public bool changeCharacter;

	private void Start()
	{
		if (Index == 0)
		{
			animman = GameObject.Find("manmodle").GetComponent<Animator>();
		}
		if (Index == 1)
		{
			animwoman = GameObject.Find("womanmodle").GetComponent<Animator>();
		}
	}

	public void Standfront()
	{
		if (Index == 0)
		{
			animman.Play("walkforwd");
		}
		if (Index == 1)
		{
			animwoman.Play("walkforwd");
		}
	}

	public void womanStandfront()
	{
	}

	public void Select()
	{
		MainMenuManager mainMenuManager = (MainMenuManager)UnityEngine.Object.FindObjectOfType(typeof(MainMenuManager));
		if (!changeCharacter)
		{
			//if ((bool)mainMenuManager)
			//{
			//	mainMenuManager.OpenPanelByName("NewCharacter");
			//}
			CharacterCreatorCanvas characterCreatorCanvas = (CharacterCreatorCanvas)UnityEngine.Object.FindObjectOfType(typeof(CharacterCreatorCanvas));
			if ((bool)characterCreatorCanvas)
			{
				characterCreatorCanvas.SelectCreateCharacter(Index);
			}
		}
		else
		{
			CharacterCreatorCanvas characterCreatorCanvas2 = (CharacterCreatorCanvas)UnityEngine.Object.FindObjectOfType(typeof(CharacterCreatorCanvas));
			if ((bool)characterCreatorCanvas2)
			{
				characterCreatorCanvas2.ChangeCharacter(Index);
			}
		}
	}

	public void Hover()
	{
		GUICharacterPresetLoader gUICharacterPresetLoader = (GUICharacterPresetLoader)UnityEngine.Object.FindObjectOfType(typeof(GUICharacterPresetLoader));
	}

	private void Update()
	{
	}
}
